package com.esri.core.internal.tasks.b;

import com.esri.core.internal.io.handler.h;
import com.esri.core.internal.tasks.TaskListener;
import com.esri.core.io.EsriSecurityException;
import com.esri.core.io.UserCredentials;
import com.esri.core.tasks.geodatabase.GeodatabaseStatusInfo;
import java.net.URL;
import java.util.HashMap;
import org.codehaus.jackson.JsonParser;

/* loaded from: classes.dex */
public class b extends com.esri.core.internal.tasks.d<GeodatabaseStatusInfo> {
    private static final long serialVersionUID = 1;

    public b(String str, UserCredentials userCredentials) {
        super(null, str, userCredentials);
    }

    public b(String str, UserCredentials userCredentials, TaskListener<GeodatabaseStatusInfo> taskListener) {
        super(null, str, userCredentials, taskListener);
    }

    @Override // com.esri.core.internal.tasks.a
    /* renamed from: a */
    public GeodatabaseStatusInfo execute() throws EsriSecurityException, Exception {
        String str;
        HashMap hashMap = new HashMap();
        hashMap.put("f", "json");
        String serviceURL = getServiceURL();
        try {
            String query = new URL(serviceURL).getQuery();
            if (query == null || query.length() <= 0) {
                str = serviceURL;
            } else {
                for (String str2 : query.split("&")) {
                    String[] split = str2.split("=");
                    hashMap.put(split[0], split.length > 1 ? split[1] : "");
                }
                str = serviceURL.substring(0, serviceURL.indexOf(63));
            }
            JsonParser a = h.a(str, hashMap, getServiceCredentials());
            GeodatabaseStatusInfo fromJson = GeodatabaseStatusInfo.fromJson(a);
            if (fromJson.getUpdateUrl() == null) {
                fromJson.setUpdateUrl(serviceURL);
            }
            a.close();
            return fromJson;
        } catch (Exception e) {
            return new GeodatabaseStatusInfo(e);
        }
    }
}
